<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="esy">
    
    <meta name="description" content="esy">
    
    
    
    
    
    
    <title>重新构建slpdb中的特征和标签 | ESY</title>
    <link href="https://esyyes.github.io" rel="prefetch" />

    
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">

    
<script src="/js/jquery.min.js"></script>

    
<script src="/js/bootstrap.min.js"></script>

    
<script src="/js/aos.js"></script>

    
<script src="/js/highslide/highslide-full.min.js"></script>

    
<link rel="stylesheet" href="/js/highslide/highslide.css">

    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.gif');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/avatar.jpg'
        var previews = 'preview1.jpg,preview2.jpg,preview3.jpg,preview4.jpg'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->
<meta name="generator" content="Hexo 5.2.0"></head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <div class="gal-menu gal-dropdown">
    <div class="circle" id="gal">
        <div class="ring">
            <a href="https://esyyes.github.io" class="menuItem" style="left: 50%; top: 15%;">首页</a>
            
            <a class="menuItem" style="left: 80.3109%; top: 32.5%;">下一页</a>
            
            <a href="/archives" class="menuItem" style="left: 80.3109%; top: 67.5%;">归档</a>
            <a href="/about" class="menuItem" style="left: 50%; top: 85%;">关于</a>
            <a href="/message" class="menuItem" style="left: 19.6891%; top: 67.5%;">留言板</a>

            
            <a class="menuItem" style="left: 19.6891%; top: 32.5%;">上一页</a>
            
        </div>
        <audio id="audio" src="/imgs/oni.mp3"></audio>
    </div>
</div>
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://esyyes.github.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">ESY</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-list"></i>分类
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/categories/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/categories/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/categories/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo%E5%AE%8C%E5%96%84/">-hexo完善</a>
                        </li>
                        
                        
                        <li>
                            <a href="/categories">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/tags/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/tags/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">-个人博客搭建</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://esyyes.github.io">ESY</a>
        >
        <span>重新构建slpdb中的特征和标签</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2020/08/20/python%20work/%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BAslpdb%E4%B8%AD%E7%9A%84%E7%89%B9%E5%BE%81%E5%92%8C%E6%A0%87%E7%AD%BE/">重新构建slpdb中的特征和标签</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/work/">work</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2020-08-20
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2020/08/20/python%20work/%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BAslpdb%E4%B8%AD%E7%9A%84%E7%89%B9%E5%BE%81%E5%92%8C%E6%A0%87%E7%AD%BE/">重新构建slpdb中的特征和标签</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2020-08-20
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/work/">work</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <h1 id="重新构建slpdb中的特征和标签"><a href="#重新构建slpdb中的特征和标签" class="headerlink" title="重新构建slpdb中的特征和标签"></a>重新构建slpdb中的特征和标签</h1><p>slpdb数据库在当时处理hrv信号的时候，错误的将循环时候的j从11开始了，貌似影响不大，但反正都要重新生成ucddb数据，就直接写出来然后那个计算器去运行吧</p>
<p>这一步，就讲数据的行对齐</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> wfdb</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line">text_name = pd.read_excel(<span class="string">&#x27;F:/slpdb_data/mitdata/slpdb_name.xlsx&#x27;</span>)</span><br><span class="line">slpdb_name = np.array(text_name).tolist()</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> text <span class="keyword">in</span> slpdb_name:</span><br><span class="line">    annotation = wfdb.rdann(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % text[<span class="number">0</span>], <span class="string">&#x27;st&#x27;</span>)</span><br><span class="line">    aux = annotation.aux_note</span><br><span class="line">    sample_min = annotation.sample.<span class="built_in">min</span>()</span><br><span class="line">    sample_max = annotation.sample.<span class="built_in">max</span>()</span><br><span class="line">    print(<span class="string">f&#x27;<span class="subst">&#123;text[<span class="number">0</span>]&#125;</span>起始位置为<span class="subst">&#123;sample_min&#125;</span>, 终止位置为<span class="subst">&#123;sample_max&#125;</span>&#x27;</span>)</span><br><span class="line"></span><br><span class="line">slp01a起始位置为<span class="number">1</span>, 终止位置为<span class="number">1792500</span></span><br><span class="line">slp01b起始位置为<span class="number">1</span>, 终止位置为<span class="number">2692500</span></span><br><span class="line">slp02a起始位置为<span class="number">1</span>, 终止位置为<span class="number">2692500</span></span><br><span class="line">slp02b起始位置为<span class="number">1</span>, 终止位置为<span class="number">2017500</span></span><br><span class="line">slp03起始位置为<span class="number">1</span>, 终止位置为<span class="number">5392500</span></span><br><span class="line">slp04起始位置为<span class="number">1</span>, 终止位置为<span class="number">5392500</span></span><br><span class="line">slp14起始位置为<span class="number">45000</span>, 终止位置为<span class="number">5392500</span></span><br><span class="line">slp16起始位置为<span class="number">195000</span>, 终止位置为<span class="number">5392500</span></span><br><span class="line">slp32起始位置为<span class="number">1</span>, 终止位置为<span class="number">4792500</span></span><br><span class="line">slp37起始位置为<span class="number">15000</span>, 终止位置为<span class="number">5242500</span></span><br><span class="line">slp41起始位置为<span class="number">1</span>, 终止位置为<span class="number">5842500</span></span><br><span class="line">slp45起始位置为<span class="number">1</span>, 终止位置为<span class="number">5692500</span></span><br><span class="line">slp48起始位置为<span class="number">1</span>, 终止位置为<span class="number">5692500</span></span><br><span class="line">slp59起始位置为<span class="number">165000</span>, 终止位置为<span class="number">3592500</span></span><br><span class="line">slp60起始位置为<span class="number">1</span>, 终止位置为<span class="number">5317500</span></span><br><span class="line">slp61起始位置为<span class="number">150000</span>, 终止位置为<span class="number">5542500</span></span><br><span class="line">slp66起始位置为<span class="number">1</span>, 终止位置为<span class="number">3285000</span></span><br><span class="line">slp67x起始位置为<span class="number">1</span>, 终止位置为<span class="number">1147500</span></span><br></pre></td></tr></table></figure>

<p>第一就是起始位置的问题，然后就是有两个数据缺失的问题</p>
<h2 id="首尾数据缺失问题"><a href="#首尾数据缺失问题" class="headerlink" title="首尾数据缺失问题"></a>首尾数据缺失问题</h2><p>首先查看下是否缺失的数据对应的aux不变</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">[<span class="number">23</span>:<span class="number">51</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]    <span class="number">45000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:51:30.000 30/03/1989]    52500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">52</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]    <span class="number">60000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:52:30.000 30/03/1989]    67500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">53</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]    <span class="number">75000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:53:30.000 30/03/1989]    82500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">54</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]    <span class="number">90000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:54:30.000 30/03/1989]    97500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">55</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]   <span class="number">105000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:55:30.000 30/03/1989]   112500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">56</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]   <span class="number">120000</span>     <span class="string">&quot;    0    0    0	1</span></span><br><span class="line"><span class="string">[23:56:30.000 30/03/1989]   127500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">57</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]   <span class="number">135000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:57:30.000 30/03/1989]   142500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">23</span>:<span class="number">58</span>:<span class="number">00.000</span> <span class="number">30</span>/<span class="number">03</span>/<span class="number">1989</span>]   <span class="number">150000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[23:58:30.000 30/03/1989]   157500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br></pre></td></tr></table></figure>

<p>数据缺失对应的即为标签的缺失。因此标签并没有过多的改变</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[<span class="number">00</span>:<span class="number">01</span>:<span class="number">00.000</span> <span class="number">07</span>/<span class="number">04</span>/<span class="number">1989</span>]   <span class="number">195000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[00:01:30.000 07/04/1989]   202500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">00</span>:<span class="number">02</span>:<span class="number">00.000</span> <span class="number">07</span>/<span class="number">04</span>/<span class="number">1989</span>]   <span class="number">210000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[00:02:30.000 07/04/1989]   217500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br><span class="line">[<span class="number">00</span>:<span class="number">03</span>:<span class="number">00.000</span> <span class="number">07</span>/<span class="number">04</span>/<span class="number">1989</span>]   <span class="number">225000</span>     <span class="string">&quot;    0    0    0	W</span></span><br><span class="line"><span class="string">[00:03:30.000 07/04/1989]   232500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	W</span><br></pre></td></tr></table></figure>

<p>因此可以直接根据slpdb中的起始和末尾位置进行生成</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/20</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> wfdb</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line">text_name = pd.read_excel(<span class="string">&#x27;F:/slpdb_data/mitdata/slpdb_name.xlsx&#x27;</span>)</span><br><span class="line">slpdb_name = np.array(text_name[<span class="string">&#x27;name&#x27;</span>]).tolist()</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> text <span class="keyword">in</span> slpdb_name:</span><br><span class="line">    annotation = wfdb.rdann(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % text, <span class="string">&#x27;st&#x27;</span>)</span><br><span class="line">    aux = annotation.aux_note</span><br><span class="line">    sample_min = annotation.sample.<span class="built_in">min</span>()</span><br><span class="line">    sample_max = annotation.sample.<span class="built_in">max</span>()</span><br><span class="line">    print(<span class="string">f&#x27;<span class="subst">&#123;text[<span class="number">0</span>]&#125;</span>起始位置为<span class="subst">&#123;sample_min&#125;</span>, 终止位置为<span class="subst">&#123;sample_max&#125;</span>&#x27;</span>)</span><br><span class="line">    <span class="keyword">if</span> text == <span class="string">&#x27;slp03&#x27;</span> <span class="keyword">or</span> text == <span class="string">&#x27;slp60&#x27;</span>:</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        tag1 = []</span><br><span class="line">        tag2 = []</span><br><span class="line">        tag3 = []</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">5</span>, <span class="built_in">int</span>(<span class="built_in">len</span>(aux)<span class="number">-5</span>)):</span><br><span class="line">            <span class="keyword">if</span> (aux[i][<span class="number">0</span>] == <span class="string">&#x27;4&#x27;</span>) <span class="keyword">or</span> (aux[i][<span class="number">0</span>] == <span class="string">&#x27;3&#x27;</span>):</span><br><span class="line">                tag1.append(<span class="number">1</span>)</span><br><span class="line">                tag2.append(<span class="number">1</span>)</span><br><span class="line">                tag3.append(<span class="number">1</span>)</span><br><span class="line">            <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;2&#x27;</span>:</span><br><span class="line">                tag1.append(<span class="number">2</span>)</span><br><span class="line">                tag2.append(<span class="number">2</span>)</span><br><span class="line">                tag3.append(<span class="number">1</span>)</span><br><span class="line">            <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;1&#x27;</span>:</span><br><span class="line">                tag1.append(<span class="number">3</span>)</span><br><span class="line">                tag2.append(<span class="number">2</span>)</span><br><span class="line">                tag3.append(<span class="number">1</span>)</span><br><span class="line">            <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;R&#x27;</span>:</span><br><span class="line">                tag1.append(<span class="number">4</span>)</span><br><span class="line">                tag2.append(<span class="number">3</span>)</span><br><span class="line">                tag3.append(<span class="number">2</span>)</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                tag1.append(<span class="number">5</span>)</span><br><span class="line">                tag2.append(<span class="number">4</span>)</span><br><span class="line">                tag3.append(<span class="number">3</span>)</span><br><span class="line"></span><br><span class="line">        label1 = pd.DataFrame(tag1, columns=[<span class="string">&#x27;N321RW&#x27;</span>])</span><br><span class="line">        label2 = pd.DataFrame(tag2, columns=[<span class="string">&#x27;DLRW&#x27;</span>])</span><br><span class="line">        label3 = pd.DataFrame(tag3, columns=[<span class="string">&#x27;NRW&#x27;</span>])</span><br><span class="line">        label = pd.concat([label1, label2, label3], axis=<span class="number">1</span>)</span><br><span class="line">        label.to_excel(<span class="string">&#x27;note_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % text + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br></pre></td></tr></table></figure>

<p>生成对应的slpdb_note标签</p>
<p>标签数据缺失</p>
<p>直接根据缺失的来的，所以可以暂时不管这个了。待会儿看下那个slpdb中中间数据是ecg数据缺失还是标签缺失</p>
<table>
<thead>
<tr>
<th><code>rdann -r slpdb/slp01a -f 0 -t 7200 -a st -v &gt;annotations.txt</code></th>
<th><a target="_blank" rel="noopener" href="https://archive.physionet.org/physiobank/annotations.shtml">Annotation key</a></th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<hr>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">[<span class="number">23</span>:<span class="number">07</span>:<span class="number">00.004</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]        <span class="number">1</span>     <span class="string">&quot;    0    0    0	4 LA LA</span></span><br><span class="line"><span class="string">[23:07:30.000 19/01/1989]     7500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> LA</span><br><span class="line">[<span class="number">23</span>:<span class="number">08</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">15000</span>     <span class="string">&quot;    0    0    0	4 LA</span></span><br><span class="line"><span class="string">[23:08:30.000 19/01/1989]    22500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> L L L</span><br><span class="line">[<span class="number">23</span>:<span class="number">09</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">30000</span>     <span class="string">&quot;    0    0    0	4 L</span></span><br><span class="line"><span class="string">[23:09:30.000 19/01/1989]    37500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> L</span><br><span class="line">[<span class="number">23</span>:<span class="number">10</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">45000</span>     <span class="string">&quot;    0    0    0	4 L L</span></span><br><span class="line"><span class="string">[23:10:30.000 19/01/1989]    52500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> L</span><br><span class="line">[<span class="number">23</span>:<span class="number">11</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">60000</span>     <span class="string">&quot;    0    0    0	4 L</span></span><br><span class="line"><span class="string">[23:11:30.000 19/01/1989]    67500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> L L</span><br><span class="line">[<span class="number">23</span>:<span class="number">12</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">75000</span>     <span class="string">&quot;    0    0    0	4 L L L</span></span><br><span class="line"><span class="string">[23:12:30.000 19/01/1989]    82500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">4</span> LA</span><br><span class="line">[<span class="number">23</span>:<span class="number">13</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]    <span class="number">90000</span>     <span class="string">&quot;    0    0    0	3 HA</span></span><br><span class="line"><span class="string">[23:13:30.000 19/01/1989]    97500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">3</span> H LA</span><br><span class="line">[<span class="number">23</span>:<span class="number">14</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]   <span class="number">105000</span>     <span class="string">&quot;    0    0    0	3 LA</span></span><br><span class="line"><span class="string">[23:14:30.000 19/01/1989]   112500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">2</span> LA</span><br><span class="line">[<span class="number">23</span>:<span class="number">15</span>:<span class="number">00.000</span> <span class="number">19</span>/<span class="number">01</span>/<span class="number">1989</span>]   <span class="number">120000</span>     <span class="string">&quot;    0    0    0	2 LA</span></span><br><span class="line"><span class="string">[23:15:30.000 19/01/1989]   127500     &quot;</span>    <span class="number">0</span>    <span class="number">0</span>    <span class="number">0</span>	<span class="number">2</span> LA</span><br></pre></td></tr></table></figure>

<p>标签数目比特征多一个，因此删除最后一个标签即可</p>
<h2 id="中间数据缺失的问题"><a href="#中间数据缺失的问题" class="headerlink" title="中间数据缺失的问题"></a>中间数据缺失的问题</h2><p>slp03和slp60</p>
<p>先确定是什么缺失</p>
<p>标签无缺失。观看数据</p>
<p>所以现在处理中间数据的标签</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/20</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 将5分钟的数据进行30s窗口的滑窗切片，然后进行输出为list</span></span><br><span class="line"><span class="comment"># 5min的进行单独的分析，然后进行时频域和非线性的分析</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> wfdb</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">from</span> wfdb <span class="keyword">import</span> processing</span><br><span class="line"><span class="comment"># import numpy as np</span></span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"><span class="keyword">from</span> peaks_time_features <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> time_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> frequency_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> nonliner_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> eliminate_outliers <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> HRV_interp1 <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"><span class="comment"># test = input(&#x27;请输入文件名：&#x27;)</span></span><br><span class="line"><span class="comment"># test = &#x27;slp03&#x27;</span></span><br><span class="line">test = <span class="string">&#x27;slp60&#x27;</span></span><br><span class="line">record = wfdb.rdrecord(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % test, channels=[<span class="number">0</span>])</span><br><span class="line">annotation = wfdb.rdann(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % test, <span class="string">&#x27;ecg&#x27;</span>)</span><br><span class="line"></span><br><span class="line">annotation1 = wfdb.rdann(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % test, <span class="string">&#x27;st&#x27;</span>)</span><br><span class="line">aux = annotation1.aux_note</span><br><span class="line">sample_min = annotation1.sample.<span class="built_in">min</span>()</span><br><span class="line">sample_max = annotation1.sample.<span class="built_in">max</span>()</span><br><span class="line"></span><br><span class="line">ecg_signal = record.p_signal</span><br><span class="line">ecg_locs = annotation.sample.tolist()</span><br><span class="line">ecg_locs.pop(<span class="number">0</span>)</span><br><span class="line">min_bpm = <span class="number">40</span></span><br><span class="line">max_bpm = <span class="number">200</span></span><br><span class="line"></span><br><span class="line">search_radius = <span class="built_in">int</span>(record.fs * <span class="number">60</span> / max_bpm)</span><br><span class="line">ecg_r_locs1 = processing.correct_peaks(ecg_signal[:, <span class="number">0</span>], peak_inds=ecg_locs,</span><br><span class="line">                                       search_radius=search_radius, smooth_window_size=<span class="number">100</span>)</span><br><span class="line"><span class="comment"># ecg_r_locs异常点处理</span></span><br><span class="line">ecg_r_locs = eliminate(ecg_r_locs1)</span><br><span class="line"><span class="comment"># ecg_r_peaks峰值点获取</span></span><br><span class="line">ecg_r_peaks = [ecg_signal[<span class="built_in">int</span>(ecg_r_locs[i])][<span class="number">0</span>]+<span class="number">0.7</span> <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs))]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">all_RR_5m = []</span><br><span class="line">all_locs_5m = []</span><br><span class="line">all_peaks_5m = []</span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">int</span>(sample_min/<span class="number">7500</span>), <span class="built_in">int</span>(record.sig_len/record.fs/<span class="number">30</span> - <span class="number">11</span>)):</span><br><span class="line">    <span class="comment"># if 168 &lt; i &lt; 200:</span></span><br><span class="line">    <span class="keyword">if</span> <span class="number">532</span> &lt; i &lt; <span class="number">555</span>:</span><br><span class="line">        <span class="comment"># slp60</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        RR_300s = []</span><br><span class="line">        locs_300s = []</span><br><span class="line">        peaks_300s = []</span><br><span class="line">        <span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs)):</span><br><span class="line">            <span class="keyword">if</span> (<span class="number">30</span>*record.fs*i) &lt;= ecg_r_locs[j] &lt;= (<span class="number">30</span>*record.fs*(i+<span class="number">10</span>)):</span><br><span class="line">                locs_300s.append(ecg_r_locs[j])</span><br><span class="line">                RR_300s.append((ecg_r_locs[j+<span class="number">1</span>] - ecg_r_locs[j]) * <span class="number">4</span>)</span><br><span class="line">                peaks_300s.append(ecg_r_peaks[j])</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">        RR_300s.pop()</span><br><span class="line">        all_RR_5m.append(RR_300s)</span><br><span class="line">        all_locs_5m.append(locs_300s)</span><br><span class="line">        all_peaks_5m.append(peaks_300s)</span><br><span class="line"></span><br><span class="line"><span class="comment"># ECG_R</span></span><br><span class="line">peaks_features = [peaks_time_feature(all_peaks_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_peaks_5m))]</span><br><span class="line"><span class="comment"># HRV</span></span><br><span class="line">hrv_time = [time_features(all_RR_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line"><span class="comment"># hrv_freq = [getfreq(resample(hrv_interp1(all_locs_5m[i], all_RR_5m[i], 10), 250, 4)) for i in range(len(all_RR_5m))]</span></span><br><span class="line">hrv_freq = [getfreq(all_RR_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line">hrv_nonl = [non_linear5(np.array(all_RR_5m[i])) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line">features = [peaks_features[i] + hrv_time[i] + hrv_freq[i] + hrv_nonl[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">all_RR_30s = []</span><br><span class="line">all_locs_30s = []</span><br><span class="line">all_peaks_30s = []</span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">int</span>(sample_min/<span class="number">7500</span>), <span class="built_in">int</span>(record.sig_len/record.fs/<span class="number">30</span> - <span class="number">1</span>)):</span><br><span class="line">    <span class="comment"># if 168 &lt; i &lt; 200:</span></span><br><span class="line">    <span class="keyword">if</span> <span class="number">532</span> &lt; i &lt; <span class="number">555</span>:</span><br><span class="line">        <span class="comment"># slp60</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        RR_30s = []</span><br><span class="line">        locs_30s = []</span><br><span class="line">        peaks_30s = []</span><br><span class="line">        <span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs)):</span><br><span class="line">            <span class="keyword">if</span> (<span class="number">30</span>*record.fs*i) &lt;= ecg_r_locs[j] &lt;= (<span class="number">30</span>*record.fs*(i+<span class="number">1</span>)):</span><br><span class="line">                locs_30s.append(ecg_r_locs[j])</span><br><span class="line">                RR_30s.append((ecg_r_locs[j+<span class="number">1</span>] - ecg_r_locs[j]) * <span class="number">4</span>)</span><br><span class="line">                peaks_30s.append(ecg_r_peaks[j])</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">        RR_30s.pop()</span><br><span class="line">        all_RR_30s.append(RR_30s)</span><br><span class="line">        <span class="keyword">del</span> locs_30s[<span class="number">0</span>]</span><br><span class="line">        all_locs_30s.append(locs_30s)</span><br><span class="line">        all_peaks_30s.append(peaks_30s)</span><br><span class="line"></span><br><span class="line"><span class="comment"># ECG_R</span></span><br><span class="line">peaks_features1 = [peaks_time_feature(all_peaks_30s[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_peaks_30s))]</span><br><span class="line"><span class="comment"># HRV</span></span><br><span class="line">hrv_time1 = [time_features(all_RR_30s[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">hrv_freq1 = [getfreq(resample(hrv_interp1(all_locs_30s[i], all_RR_30s[i], <span class="number">1</span>), <span class="number">250</span>, <span class="number">4</span>)) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">hrv_nonl1 = [non_linear(np.array(all_RR_30s[i])) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">features1 = [peaks_features1[i] + hrv_time1[i] + hrv_freq1[i] + hrv_nonl1[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">features30 = features1[<span class="number">5</span>:(<span class="built_in">len</span>(features1)<span class="number">-5</span>)]</span><br><span class="line"></span><br><span class="line">features50 = [features30[i] + features[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(features))]</span><br><span class="line"></span><br><span class="line"><span class="comment"># 保存为excel</span></span><br><span class="line">feature = pd.DataFrame(features50, columns=[<span class="string">&#x27;p_max&#x27;</span>, <span class="string">&#x27;p_min&#x27;</span>, <span class="string">&#x27;p_mean&#x27;</span>, <span class="string">&#x27;p_median&#x27;</span>, <span class="string">&#x27;p_SDNN&#x27;</span>, <span class="string">&#x27;p_var&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;p_Peaks&#x27;</span>, <span class="string">&#x27;p_RMSSD&#x27;</span>, <span class="string">&#x27;p_kurt&#x27;</span>, <span class="string">&#x27;p_skew&#x27;</span>, <span class="string">&#x27;p_wave_factor&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;p_peak_factor&#x27;</span>, <span class="string">&#x27;p_Impulse_factor&#x27;</span>, <span class="string">&#x27;p_Margin_factor&#x27;</span>, <span class="string">&#x27;p_RMS&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;R_mean&#x27;</span>, <span class="string">&#x27;R_SDNN&#x27;</span>, <span class="string">&#x27;R_SDSD&#x27;</span>, <span class="string">&#x27;NN50&#x27;</span>, <span class="string">&#x27;pNN50&#x27;</span>, <span class="string">&#x27;NN20&#x27;</span>, <span class="string">&#x27;pNN20&#x27;</span>, <span class="string">&#x27;R_RMSSD&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;R_median&#x27;</span>, <span class="string">&#x27;R_NUM&#x27;</span>, <span class="string">&#x27;R_CVSD&#x27;</span>, <span class="string">&#x27;R_CV&#x27;</span>, <span class="string">&#x27;HR_mean&#x27;</span>, <span class="string">&#x27;HR_max&#x27;</span>, <span class="string">&#x27;HR_min&#x27;</span>, <span class="string">&#x27;HR_std&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;LF&#x27;</span>, <span class="string">&#x27;HF&#x27;</span>, <span class="string">&#x27;LF_HF&#x27;</span>, <span class="string">&#x27;LFnu&#x27;</span>, <span class="string">&#x27;HFnu&#x27;</span>, <span class="string">&#x27;total&#x27;</span>, <span class="string">&#x27;VLF&#x27;</span>, <span class="string">&#x27;sd1&#x27;</span>, <span class="string">&#x27;sd2&#x27;</span>, <span class="string">&#x27;sd2/sd1&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;csi10&#x27;</span>, <span class="string">&#x27;cvi&#x27;</span>, <span class="string">&#x27;Modified_CSI10&#x27;</span>, <span class="string">&#x27;apen&#x27;</span>, <span class="string">&#x27;spen&#x27;</span>, <span class="string">&#x27;lle&#x27;</span>, <span class="string">&#x27;sampen&#x27;</span>,</span><br><span class="line"></span><br><span class="line">                                            <span class="string">&#x27;5p_max&#x27;</span>, <span class="string">&#x27;5p_min&#x27;</span>, <span class="string">&#x27;5p_mean&#x27;</span>, <span class="string">&#x27;5p_median&#x27;</span>, <span class="string">&#x27;5p_SDNN&#x27;</span>, <span class="string">&#x27;5p_var&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5p_Peaks&#x27;</span>, <span class="string">&#x27;5p_RMSSD&#x27;</span>, <span class="string">&#x27;5p_kurt&#x27;</span>, <span class="string">&#x27;5p_skew&#x27;</span>, <span class="string">&#x27;5p_wave_factor&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5p_peak_factor&#x27;</span>, <span class="string">&#x27;5p_Impulse_factor&#x27;</span>, <span class="string">&#x27;5p_Margin_factor&#x27;</span>, <span class="string">&#x27;5p_RMS&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5R_mean&#x27;</span>, <span class="string">&#x27;5R_SDNN&#x27;</span>, <span class="string">&#x27;5R_SDSD&#x27;</span>, <span class="string">&#x27;5NN50&#x27;</span>, <span class="string">&#x27;5pNN50&#x27;</span>, <span class="string">&#x27;5NN20&#x27;</span>, <span class="string">&#x27;5pNN20&#x27;</span>, <span class="string">&#x27;5R_RMSSD&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5R_median&#x27;</span>, <span class="string">&#x27;5R_NUM&#x27;</span>, <span class="string">&#x27;5R_CVSD&#x27;</span>, <span class="string">&#x27;5R_CV&#x27;</span>, <span class="string">&#x27;5HR_mean&#x27;</span>, <span class="string">&#x27;5HR_max&#x27;</span>, <span class="string">&#x27;5HR_min&#x27;</span>, <span class="string">&#x27;5HR_std&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5LF&#x27;</span>, <span class="string">&#x27;5HF&#x27;</span>, <span class="string">&#x27;5LF_HF&#x27;</span>, <span class="string">&#x27;5LFnu&#x27;</span>, <span class="string">&#x27;5HFnu&#x27;</span>, <span class="string">&#x27;5total&#x27;</span>, <span class="string">&#x27;5VLF&#x27;</span>, <span class="string">&#x27;5sd1&#x27;</span>, <span class="string">&#x27;5sd2&#x27;</span>, <span class="string">&#x27;5sd2/sd1&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5csi10&#x27;</span>, <span class="string">&#x27;5csi30&#x27;</span>, <span class="string">&#x27;5csi50&#x27;</span>, <span class="string">&#x27;5csi100&#x27;</span>, <span class="string">&#x27;5cvi&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5Modified_CSI10&#x27;</span>, <span class="string">&#x27;Modified_CSI30&#x27;</span>, <span class="string">&#x27;5Modified_CSI50&#x27;</span>, <span class="string">&#x27;5Modified_CSI100&#x27;</span>,</span><br><span class="line">                                            <span class="string">&#x27;5apen&#x27;</span>, <span class="string">&#x27;5spen&#x27;</span>, <span class="string">&#x27;5lle&#x27;</span>, <span class="string">&#x27;5sampen&#x27;</span></span><br><span class="line">                                            ])</span><br><span class="line"></span><br><span class="line"><span class="comment"># num = int(input(&#x27;请输入特征的名字:&#x27;))</span></span><br><span class="line">feature.to_excel(<span class="string">&#x27;features_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % test + <span class="string">&quot;.xlsx&quot;</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/20</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> wfdb</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 读取st文件</span></span><br><span class="line"><span class="comment"># test = input(&quot;请输入想读取的文件名： &quot;)</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># test = &#x27;slp03&#x27;</span></span><br><span class="line">test = <span class="string">&#x27;slp60&#x27;</span></span><br><span class="line">annotation = wfdb.rdann(<span class="string">&#x27;F:/slpdb_data/mitdata&#x27;</span> + <span class="string">&#x27;/%s&#x27;</span> % test, <span class="string">&#x27;st&#x27;</span>)</span><br><span class="line">aux = annotation.aux_note</span><br><span class="line"><span class="comment"># record = wfdb.rdrecord(&#x27;F:/slpdb_data/mitdata&#x27; + &#x27;/%s&#x27; % test, sampfrom=1222500, sampto=1237500, channels=[3])</span></span><br><span class="line"><span class="comment"># ecg_signal = record.p_signal</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 查看低通气和osa阻塞性呼吸暂停的ecg信号取别</span></span><br><span class="line"><span class="comment"># 对标签进行处理。分为2个类别,就是正常和低通气。把osa判定为低通气</span></span><br><span class="line"></span><br><span class="line">tag1 = []</span><br><span class="line">tag2 = []</span><br><span class="line">tag3 = []</span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">5</span>, <span class="built_in">len</span>(aux)<span class="number">-5</span>):</span><br><span class="line">    <span class="keyword">if</span> <span class="number">532</span> &lt; i &lt; <span class="number">555</span>:</span><br><span class="line">    <span class="comment"># if 168 &lt; i &lt; 200:</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        <span class="keyword">if</span> (aux[i][<span class="number">0</span>] == <span class="string">&#x27;4&#x27;</span>) <span class="keyword">or</span> (aux[i][<span class="number">0</span>] == <span class="string">&#x27;3&#x27;</span>):</span><br><span class="line">            tag1.append(<span class="number">1</span>)</span><br><span class="line">            tag2.append(<span class="number">1</span>)</span><br><span class="line">            tag3.append(<span class="number">1</span>)</span><br><span class="line">        <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;2&#x27;</span>:</span><br><span class="line">            tag1.append(<span class="number">2</span>)</span><br><span class="line">            tag2.append(<span class="number">2</span>)</span><br><span class="line">            tag3.append(<span class="number">1</span>)</span><br><span class="line">        <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;1&#x27;</span>:</span><br><span class="line">            tag1.append(<span class="number">3</span>)</span><br><span class="line">            tag2.append(<span class="number">2</span>)</span><br><span class="line">            tag3.append(<span class="number">1</span>)</span><br><span class="line">        <span class="keyword">elif</span> aux[i][<span class="number">0</span>] == <span class="string">&#x27;R&#x27;</span>:</span><br><span class="line">            tag1.append(<span class="number">4</span>)</span><br><span class="line">            tag2.append(<span class="number">3</span>)</span><br><span class="line">            tag3.append(<span class="number">2</span>)</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            tag1.append(<span class="number">5</span>)</span><br><span class="line">            tag2.append(<span class="number">4</span>)</span><br><span class="line">            tag3.append(<span class="number">3</span>)</span><br><span class="line"></span><br><span class="line">label1 = pd.DataFrame(tag1, columns=[<span class="string">&#x27;N321RW&#x27;</span>])</span><br><span class="line">label2 = pd.DataFrame(tag2, columns=[<span class="string">&#x27;DLRW&#x27;</span>])</span><br><span class="line">label3 = pd.DataFrame(tag3, columns=[<span class="string">&#x27;NRW&#x27;</span>])</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">label = pd.concat([label1, label2, label3], axis=<span class="number">1</span>)</span><br><span class="line">label.to_excel(<span class="string">&#x27;note_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % test + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="比较数据的长短"><a href="#比较数据的长短" class="headerlink" title="比较数据的长短"></a>比较数据的长短</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 读取数据的名字</span></span><br><span class="line">text_name = pd.read_excel(<span class="string">&#x27;F:/slpdb_data/mitdata/slpdb_name.xlsx&#x27;</span>)</span><br><span class="line">slpdb_name = np.array(text_name[<span class="string">&#x27;name&#x27;</span>]).tolist()</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> text <span class="keyword">in</span> slpdb_name:</span><br><span class="line">    feature = pd.read_excel(<span class="string">&#x27;F:/py/py_sleep stage and apnea/data/slpdb_feature/features_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % text + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line">    label = pd.read_excel(<span class="string">&#x27;F:/py/py_sleep stage and apnea/data/slpdb_note/note_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % text + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line">    print(<span class="string">f&#x27;<span class="subst">&#123;text&#125;</span>中特征数据长为<span class="subst">&#123;<span class="built_in">len</span>(feature)&#125;</span>标签长为<span class="subst">&#123;<span class="built_in">len</span>(label)&#125;</span>&#x27;</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">slp01a中特征数据长为<span class="number">229</span>标签长为<span class="number">230</span></span><br><span class="line">slp01b中特征数据长为<span class="number">349</span>标签长为<span class="number">350</span></span><br><span class="line">slp02a中特征数据长为<span class="number">349</span>标签长为<span class="number">350</span></span><br><span class="line">slp02b中特征数据长为<span class="number">259</span>标签长为<span class="number">260</span></span><br><span class="line">slp03中特征数据长为<span class="number">678</span>标签长为<span class="number">679</span></span><br><span class="line">slp04中特征数据长为<span class="number">709</span>标签长为<span class="number">710</span></span><br><span class="line">slp14中特征数据长为<span class="number">703</span>标签长为<span class="number">704</span></span><br><span class="line">slp16中特征数据长为<span class="number">683</span>标签长为<span class="number">684</span></span><br><span class="line">slp32中特征数据长为<span class="number">629</span>标签长为<span class="number">630</span></span><br><span class="line">slp37中特征数据长为<span class="number">687</span>标签长为<span class="number">688</span></span><br><span class="line">slp41中特征数据长为<span class="number">769</span>标签长为<span class="number">770</span></span><br><span class="line">slp45中特征数据长为<span class="number">749</span>标签长为<span class="number">750</span></span><br><span class="line">slp48中特征数据长为<span class="number">749</span>标签长为<span class="number">750</span></span><br><span class="line">slp59中特征数据长为<span class="number">447</span>标签长为<span class="number">448</span></span><br><span class="line">slp60中特征数据长为<span class="number">677</span>标签长为<span class="number">678</span></span><br><span class="line">slp61中特征数据长为<span class="number">709</span>标签长为<span class="number">710</span></span><br><span class="line">slp66中特征数据长为<span class="number">429</span>标签长为<span class="number">429</span></span><br><span class="line">slp67x中特征数据长为<span class="number">143</span>标签长为<span class="number">144</span></span><br></pre></td></tr></table></figure>

<p>就以后标签就直接取data长度吧</p>
<p><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597915511863&di=7b5df141d439f7c60e83cf93a191c138&imgtype=0&src=http://n.sinaimg.cn/translate/20170517/HrO7-fyfeutq1597299.jpg"></p>

    </div>
</article>


                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~" autocomplete="off">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            esy
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/avatar.jpg" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"><p>esy</p>
</p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%98%E6%B3%95/">最小二乘法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E7%BB%9F%E8%AE%A1%E5%AD%A6%E4%B9%A0-%E7%AC%AC%E4%B8%80%E7%AB%A0/">统计学习--第一章</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/04/python%20work/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/03/python%20work/%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%AF%84%E4%BC%B0%E6%8C%87%E6%A0%87/">分类模型的评估指标</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/10/21/python%20work/10-21-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80/">10-21 爬虫基础</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/CRF%E7%9A%84%E6%95%B4%E4%BD%93%E6%B5%81%E7%A8%8B%E7%BB%93%E6%9E%9C/">CRF的整体流程结果</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/nlp-crf%E6%A8%A1%E5%9E%8B/">nlp_crf模型</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%983/">数学建模问题3</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%982/">数学建模问题2</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%981/">数学建模问题1</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/28/python%20work/GUI%E7%95%8C%E9%9D%A2%E7%9A%84%E5%AE%8C%E5%96%84/">GUI界面的完善</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/11/24/python%20work/pyhon%E5%9F%BA%E7%A1%80-%E6%A8%A1%E5%9D%97/">pyhon基础--模块</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/03/22/python%20work/python-Accuracy-Precison-Recall-F1-score/">python_Accuracy,Precison,Recall,F1 score</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/05/25/python%20work/python%E2%80%94%E2%80%94%E5%85%A5%E9%97%A8%E5%A4%8D%E4%B9%A0%E6%95%B0%E6%8D%AE%E5%BA%8F%E5%88%97/">python——入门复习数据序列</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/12/26/python%20work/python%E8%B0%83%E7%94%A8wfdb/">LV-3</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/29/python%20work/%E4%B8%AD%E6%9C%9F%E7%AD%94%E8%BE%A9%E9%A2%98%E7%9B%AE/">中期答辩题目</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/31/python%20work/%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E5%9F%BA%E4%BA%8E%E4%BA%A4%E5%8F%89%E9%AA%8C%E8%AF%81%E8%BF%9B%E8%A1%8C%E8%AF%84%E4%BC%B0/">分类模型基于交叉验证进行评估</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/22/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E5%92%8C%E5%88%86%E6%9E%90/">数学建模和分析</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/05/28/python%20work/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%89%88%E5%AD%A6%E5%91%98%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/">面向对象版学员管理系统</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/09/python%20work/HMM%E4%B9%8B%E6%95%B0%E6%8D%AE%E7%9A%84%E5%A4%84%E7%90%86/">HMM之数据的处理</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">

                
                <li>
                    <a href="/2020/08/20/python%20work/%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BAslpdb%E4%B8%AD%E7%9A%84%E7%89%B9%E5%BE%81%E5%92%8C%E6%A0%87%E7%AD%BE/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                
                
                <li>
                    <a href="/2020/08/20/python%20work/%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BAslpdb%E4%B8%AD%E7%9A%84%E7%89%B9%E5%BE%81%E5%92%8C%E6%A0%87%E7%AD%BE/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                
                
                <li>
                    <a href="/2020/08/20/python%20work/%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BAslpdb%E4%B8%AD%E7%9A%84%E7%89%B9%E5%BE%81%E5%92%8C%E6%A0%87%E7%AD%BE/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
                
            </ul>
            <div class="tab-content">
                
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/py-study/" style="font-size: 17.224204708832758px;" class="tag-cloud-link">py_study</a>
    
    <a href="/tags/nlp/" style="font-size: 14.575802402242743px;" class="tag-cloud-link">nlp</a>
    
    <a href="/tags/Graduation-work/" style="font-size: 13.398105477859836px;" class="tag-cloud-link">Graduation work</a>
    
    <a href="/tags/work/" style="font-size: 14.629269760378047px;" class="tag-cloud-link">work</a>
    
    <a href="/tags/hexo/" style="font-size: 19.8681140137136px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="font-size: 13.480014827111484px;" class="tag-cloud-link">-个人博客搭建</a>
    
    <a href="/tags/malab-%E6%AF%95%E4%B8%9A/" style="font-size: 13.003146489065488px;" class="tag-cloud-link">-malab -毕业</a>
    
    <a href="/tags/python-%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/" style="font-size: 14.153557701500837px;" class="tag-cloud-link">-python -人工智能</a>
    
    <a href="/tags/python/" style="font-size: 17.14071679296209px;" class="tag-cloud-link">python</a>
    
    <a href="/tags/python/" style="font-size: 15.588535616061964px;" class="tag-cloud-link">-python</a>
    
    <a href="/tags/mathematical-modeling/" style="font-size: 18.08952290115948px;" class="tag-cloud-link">mathematical modeling</a>
    
    <a href="/tags/statistical-learning/" style="font-size: 14.541527256273984px;" class="tag-cloud-link">statistical learning</a>
    
</div>
                
                
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://kdays.net/days/" target="_blank">KDays Forum</a>
    </li>
    
    <li>
        <a href="http://www.gal123.com/" target="_blank">绅士导航♂</a>
    </li>
    
    <li>
        <a href="http://www.moe123.com/" target="_blank">萌导航</a>
    </li>
    
</div>
                
                
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/ZEROKISEKI/" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="https://coding.net/u/SORA1" target="_blank">Coding</a>
    </li>
    
    <li>
        <a href="https://www.zhihu.com/people/aonosora/activities" target="_blank">知乎</a>
    </li>
    
</div>
                
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 esy Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>

<script src="/js/activate-power-mode.js"></script>

<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>

<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



<script src="/js/oni.js"></script>




</html>